let channel = channels[i];
let [targetHandle, targetHandleType] = channel.get_handle();
+ if (Shell.is_channel_invalidated(channel))
+ continue;
+
/* Only observe contact text channels */
if ((!(channel instanceof Tp.TextChannel)) ||
targetHandleType != Tp.HandleType.CONTACT)
continue;
}
+ if (Shell.is_channel_invalidated(channel))
+ continue;
+
// 'notify' will be true when coming from an actual HandleChannels
// call, and not when from a successful Claim call. The point is
// we don't want to notify for a channel we just claimed which
let channel = channels[0];
let chanType = channel.get_channel_type();
+ if (Shell.is_channel_invalidated(channel)) {
+ Shell.decline_dispatch_op(context, 'Channel is invalidated');
+ return;
+ }
+
if (chanType == Tp.IFACE_CHANNEL_TYPE_TEXT)
this._approveTextChannel(account, conn, channel, dispatchOp, context);
else if (chanType == Tp.IFACE_CHANNEL_TYPE_CALL)
tp_add_dispatch_operation_context_fail (context, error);
g_error_free (error);
}
+
+/* gjs doesn't cope with tp_proxy_get_invalidated() returning a GError */
+gboolean shell_is_channel_invalidated (TpChannel *channel)
+{
+ return tp_proxy_get_invalidated (channel) != NULL;
+}
void shell_decline_dispatch_op (TpAddDispatchOperationContext *context,
const gchar *message);
+gboolean shell_is_channel_invalidated (TpChannel *channel);
+
G_END_DECLS
#endif /* __SHELL_TP_CLIENT_H__ */